<div class="upload">
	<div id="list<?php echo $append;?>" class="upload_img">
		<?php if(file_exists('.'.$src)&&!empty($src)): ?>
		<div class="bos_upload bos_upload_del">
			<img class="listsimg" src="{$src}" width="150" />
			<a href="javascript:void(0)" onclick="del_one(this);" data-id="{$del_one_id??''}" data-url="{$do??''}" class="del_success">x</a>
		</div>
		<?php endif; ?>
	</div>
	<button type="button" class="layui-btn" id="test1">
		<i class="layui-icon">&#xe67c;</i>
		<span id="picker<?php echo $append;?>">上传图片</span>	
	</button>
</div>
<script type="text/javascript">
	function del_one(a){
		var src = $(a).parent().children('img').attr('src');
		var url = $(a).attr('data-url');
		var $del_one_id = $(a).attr('data-id');
		$.post(url,{"del_src":src,"del_one_id":$del_one_id},function(data){
			if(data.s == 1){
				$(a).parent().remove();
			}else{
				console.log(data.i);
				alert(data.i);
			}
		});
	}
	$(document).ready(function(){
		var uploader = new WebUploader.Uploader({
			swf : "__MANAGE__/js/webuploader/Uploader.swf",
			server : "{:Url('upload/image')}",
			pick : '#picker<?php echo $append;?>',
			resize : false,
			fileVal : 'upfile',
			auto : true,
			fileNumLimit :1,
			compress: false
		});
		uploader.on('uploadSuccess',function(file,data){
			if(data.state=='SUCCESS'){
				var str = '<div class="bos_upload bos_upload_del">';
				str += '<img class="listsimg" src="'+data.thumb_src+'" />';//使用src原图 代替url缩略图
				str += '<input type="hidden" name="img<?php echo $append;?>" value="'+data.src+'" />';
				str += '</div>';
				$("#list<?php echo $append;?>").html(str);
			}else{
				alert(data.state);
			}
		});
	});
</script>
